// .txt

beginzonescript;

variables;

short im_hostile = 0;
short last_abil;
short counter = 0;
short set_ter1 = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();
	set_name(6003,"Candlesmoke");

	if (gf(60,10) > 0) {
		erase_char(30001);
		}

	if (gf(60,3) > 0) {
		erase_char(6003);
		}
	if (gf(60,7) > 0) {
		erase_char(30003);
		}

	set_boss_level(30003,2);
	set_walk_speed(6010,0);
	set_walk_speed(6011,0);

	set_name(6009,"Lady Candlesmoke");
	set_name(6010,"Lord Flingsight");
	set_name(6011,"Lord Lancefire");
	
//	set_attack_range(,);

//	add_ability(short which_char_or_group,short which_slot,short which_ability,0);

//	if (is_town_clear(ME))
//		clean_up_town();

	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	if ((set_ter1 == 0) && (gf(60,18) > 0)) {
		set_ter1 = 1;
		set_terrain(0,38,36,0);
		}
	
	if ((is_talking() == 0) && (gf(60,10) == 0) && (gf(60,7) == 0) && (char_ok(6009) == FALSE) && (char_ok(6010) == FALSE) && (char_ok(6011) == FALSE)) {	
		award_party_xp(MED_QUEST_XP);
		clear_town(60);
		sf(60,10,1);
		begin_talk_mode(19);
		}
	// if (gf(,) == 0) {
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6003,"Welcome!");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6003,"We're finally open.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6003,"We have rooms.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6003,"We can craft.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(6003,"The Nisse mean no harm.");
	//	}

	//if (gf(,) < 2) {
	//	inc_flag(,,1);
	//	if (gf(,) == 2)
	//		begin_talk_mode();
	//	}

	if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_town()) && (tick_difference(last_abil,get_current_tick()) > 0))) {
		last_abil = get_current_tick();
		if (is_talking() == FALSE) {
			if (gf(60,23) > 0)
				sf(60,23,0);
				else if (gf(60,24) == 1) {
					sf(60,24,2);
					talk_no_exit(40);
					}
				else if (gf(60,25) == 1) {
					sf(60,25,2);
					talk_no_exit(70);
					}
				else if (gf(60,26) == 1) {
					sf(60,26,2);
					talk_no_exit(100);
					}
			}
			
		}
break;

beginstate 10;
break;

beginstate 11;
break;

beginstate 12;
break;

beginstate 13;
break;

//	print_str("");
//	set_terrain_string_range(".",1);
//	set_terrain_string_range("The sign says - .",1);
